package com.example.test;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.example.test.async.AsycnActivity;
import com.example.test.broadcast.TestActivity;
import com.example.test.content.MyContentProviderActivity;
import com.example.test.newtab.FragmentTabs;
import com.example.test.service.TestServiceActivity;

public class MainActivity extends Activity {

	private Button btn_main_notify;
	private Button btn_main_gridview;
	private Button btn_main_listview;
	private Button btn_main_broadcast;
	private Button btn_main_service;
	private Button btn_tab_new;
	private Button btn_content_provider;
	private Button btn_async_main;
	private Context context = this;

	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		btn_main_notify = (Button) findViewById(R.id.btn_main_notify);
		btn_main_gridview = (Button) findViewById(R.id.btn_main_gridview);
		btn_main_listview = (Button) findViewById(R.id.btn_main_listview);
		btn_main_broadcast = (Button) findViewById(R.id.btn_main_broadcast);
		btn_main_service = (Button) findViewById(R.id.btn_main_service);
		btn_tab_new = (Button) findViewById(R.id.btn_tab_new);
		btn_content_provider = (Button) findViewById(R.id.btn_content_provider);
		btn_async_main = (Button) findViewById(R.id.btn_async_main);
		
		btn_main_notify.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(context, NotificationActivity.class);
				startActivity(intent);
			}
		});
		btn_main_gridview.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(context, GridViewActivity.class);
				startActivity(intent);
			}
		});
		btn_main_listview.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(context, ListViewActivity.class);
				startActivity(intent);
			}
		});
		btn_main_broadcast.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(context, TestActivity.class);
				startActivity(intent);
			}
		});
		btn_main_service.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(context, TestServiceActivity.class);
				startActivity(intent);
			}
		});
		btn_tab_new.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(context, FragmentTabs.class);
				startActivity(intent);
			}
		});
		btn_content_provider.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(context, MyContentProviderActivity.class);
				startActivity(intent);
			}
		});
		btn_async_main.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(context, AsycnActivity.class);
				startActivity(intent);
			}
		});
	}
}
